<template>
  <form-item :form-datas = "formDatas" :form-item = "field" :parent-comp-type = "parentCompType">
    <el-checkbox-group
        :disabled = "field.preps['disabled']"
        :fill = "field.preps['fill']"
        :label = "field.preps['label']"
        :max = "field.preps['max']"
        :min = "field.preps['min']"
        :size = "field.preps['size']"
        :text-color = "field.preps['textColor']"
        v-model = "starHorseDynamicForm[field.preps['name']]">
      <el-checkbox :border = "item['border']"
                   :checked = "item['checked']"
                   :disabled = "item['disabled']"
                   :false-label = "item['falseLabel']"
                   :label = "item['label']"
                   :true-label = "item['trueLabel']"
                   v-for = "item in field.preps['values']">

      </el-checkbox>
    </el-checkbox-group>
  </form-item>
</template>

<script>
import FormItem from "./form-item";

export default {
  name: "checkbox-item",
  components: {FormItem},
  props: {
    parentCompType: {type: Object},
    starHorseDynamicForm: {type: Object},
    field: {
      type: Object
    },
    formDatas: {type: Object}
  },
  data() {
    return {
      dataField: ""
    }
  },
  methods: {
    selectItem(data) {
      let _this = this;
      _this.$emit("selectItem", data, _this.parentCompType);
    }
  }
}
</script>

<style scoped>

</style>